Japanese Patent Application Publication No. 2007-242852 describes a switching element having a trench structure. This switching element includes a bottom p-type region in contact with a gate insulating layer at a bottom surface of a trench, and a lateral surface p-type region extending along a lateral surface of the trench and connecting a body region and the bottom p-type region. In a state where the switching element is off, a depletion layer spreads from the bottom p-type region to an n-type region around the bottom p-type region. This suppresses an electric field applied to the gate insulating layer in a vicinity of a lower end of a gate electrode. Therefore, this switching element has a high withstand voltage. Moreover when the switching element is turned on, holes flow from the body region to the bottom p-type region via the lateral surface p-type region, and thereby a potential of the bottom p-type region is maintained approximately equal to a potential of the body region. Accordingly, a potential difference between the bottom p-type region and the n-type region around the bottom p-type region becomes small, and the depletion layer that spreads in the n-type region contracts toward the bottom p-type region in a short time. Therefore, this switching element has a low on-resistance immediately after being turned on.